def quicksort(my_list, start, end):
    if start < end:
        i, j = start, end
        base = my_list[i]
        while i < j:
            while (i < j) and (my_list[j] >= base):
                j = j - 1
            my_list[i] = my_list[j]
            while (i < j) and (my_list[i] <= base):
                i = i + 1
            my_list[j] = my_list[i]
            my_list[i] = base
            quicksort(my_list, start, i - 1)
            quicksort(my_list, j + 1, end)
    return my_list


my_list = [1, 3, 8, 4, 10, 20, 20, 19, 21, 22]
print(my_list)

quicksort(my_list, 0, len(my_list) - 1)
print(my_list)
